/* 支持动态设置路由，导入页面组件 */
import { constantRouterMap } from '@/pages/map/router/index';
const permission = {
  state: {
    routers: constantRouterMap
  },
  mutations: {
    SET_ROUTERS: (state, routers) => {
      state.addRouters = routers
      state.routers = constantRouterMap;
    }
  },
  actions: {
    /* 获取登录用户的导航菜单 */
    GenerateRoutes({ commit }, userInfo) {
      const menus = constantRouterMap;
      commit('SET_ROUTERS', menus);
    }
  }
};

export default permission;
